<!DOCTYPE html>
<html>
    <head>
        <title>爱淘爱生活, 我的个人中心</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="initial-scale=1,maximum-scale=1">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/sm.min.css">
        <link rel="stylesheet" type="text/css" href="/source/site.css?<?=\Config\System::$site['version']?>">
        <link rel="shortcut icon" href="/source/icon.png">
    </head>
    <body>
        <div class="page-group">
            <div class="page">
                <header class="bar">
                    <h1 class="title">个人中心</h1>
                </header>

                <?php
                include TPL_PATH . 'toolBar.html';
                ?>

                <div class="content main-list">
                    <?php if ($wx_user || $role): ?>
                    <div class="card">
                        <div class="card-content">
                            <div class="list-block media-list">
                                <div class="item-content">
                                    <div class="item-media">
                                        <?php if (isset($wx_user['headimgurl']) && $wx_user['headimgurl']): ?>
                                        <img src="<?=$wx_user['headimgurl']?>" width="70">
                                        <?php else: ?>
                                        <img src="<?=\Config\System::$site['thumb']?>" width="70">
                                        <?php endif; ?>
                                    </div>
                                    <div class="item-inner">
                                        <div class="text list-title">
                                            <p class="font-blue">
                                                <?php if (isset($wx_user['nickname']) && $wx_user['nickname']): ?>
                                                <?=$wx_user['nickname']?>
                                                <?php elseif (isset($wx_user['id'])): ?>
                                                uid<?=$wx_user['id']?>
                                                <?php else: ?>
                                                管理员
                                                <?php endif; ?>，你好！</p>
                                            <p class="font-gray">淘宝（天猫）购物，买前领券省钱，买后收货再领红包，省了又省。</p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <?php endif; ?>

                    <div class="list-block my-menu">
                        <ul>
                            <li>
                                <a href="/search" class="external item-link item-content">
                                    <div class="item-inner">
                                        <div class="user-nav"><img src="/source/icon/so.png" width="24" />查券找券</div>
                                    </div>
                                </a>
                            </li>
                            <?php if ($wx_user): ?>
                            <li>
                                <a href="/my/order" class="external item-link item-content">
                                    <div class="item-inner">
                                        <div class="user-nav"><img src="/source/icon/order.png" width="28" />我的订单</div>
                                    </div>
                                </a>
                            </li>
                            <li>
                                <a href="/my/packet" class="external item-link item-content">
                                    <div class="item-inner">
                                        <div class="user-nav"><img src="/source/icon/packet.png" width="27" />我的红包</div>
                                    </div>
                                </a>
                            </li>
                            <li>
                                <a href="/my/invite" class="external item-link item-content">
                                    <div class="item-inner">
                                        <div class="user-nav"><img src="/source/icon/yqyj.png" width="26" />我的邀请</div>
                                    </div>
                                </a>
                            </li>
                            <?php endif; ?>
                            <li>
                                <a href="/index/soq" class="external item-link item-content">
                                    <div class="item-inner">
                                        <div class="user-nav"><img src="/source/icon/tso.png" width="27" />特别查券</div>
                                    </div>
                                </a>
                            </li>
                            <li>
                                <a href="/index/tongji" class="external item-link item-content">
                                    <div class="item-inner">
                                        <div class="user-nav"><img src="/source/icon/tongji.png" width="24" />红包统计</div>
                                    </div>
                                </a>
                            </li>
                            <?php if (in_array($role, ['admin', 'super']) || (isset($wx_user['role']) && $wx_user['role'])): ?>
                            <li>
                                <a href="/user/ulist" class="external item-link item-content">
                                    <div class="item-inner">
                                        <div class="user-nav"><img src="/source/icon/log.png" width="26" />会员日志</div>
                                    </div>
                                </a>
                            </li>
                            <?php endif; ?>
                            <?php if (in_array($role, ['admin', 'super'])): ?>
                            <li>
                                <a href="/order/index" class="external item-content item-link">
                                    <div class="item-inner">
                                        <div class="user-nav"><img src="/source/icon/oadm.png" width="26" />订单管理</div>
                                    </div>
                                </a>
                            </li>
                            <?php endif; ?>
                            <li>
                                <a href="/help/kefu" class="external item-content item-link">
                                    <div class="item-inner">
                                        <div class="user-nav"><img src="/source/icon/kefu.png" width="26" />客服咨询</div>
                                    </div>
                                </a>
                            </li>
                            <li>
                                <a href="/help/weixin" class="external item-content item-link">
                                    <div class="item-inner">
                                        <div class="user-nav"><img src="/source/icon/gzh.png" width="27" />微信公众号</div>
                                    </div>
                                </a>
                            </li>
                            <li>
                                <a href="/help/about" class="external item-content item-link">
                                    <div class="item-inner">
                                        <div class="user-nav"><img src="/source/icon/about.png" width="27" />关于</div>
                                    </div>
                                </a>
                            </li>
                        </ul>
                    </div>
                </div>
                <?php 
                include TPL_PATH . 'panel.html';
                ?>
            </div>
        </div>
        <script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
        <script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
    </body>
</html>
